using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;
namespace DataAccess
{
	#region Tables Struct
	public partial struct Tables
	{
		
		public static readonly string Aspnet_Application = @"aspnet_Applications";
        
		public static readonly string Aspnet_Membership = @"aspnet_Membership";
        
		public static readonly string Aspnet_Path = @"aspnet_Paths";
        
		public static readonly string Aspnet_PersonalizationAllUser = @"aspnet_PersonalizationAllUsers";
        
		public static readonly string Aspnet_PersonalizationPerUser = @"aspnet_PersonalizationPerUser";
        
		public static readonly string Aspnet_Profile = @"aspnet_Profile";
        
		public static readonly string Aspnet_Role = @"aspnet_Roles";
        
		public static readonly string Aspnet_SchemaVersion = @"aspnet_SchemaVersions";
        
		public static readonly string Aspnet_User = @"aspnet_Users";
        
		public static readonly string Aspnet_UsersInRole = @"aspnet_UsersInRoles";
        
		public static readonly string Aspnet_WebEvent_Event = @"aspnet_WebEvent_Events";
        
		public static readonly string TblCusFolder = @"TblCusFolder";
        
		public static readonly string TblCustomer = @"TblCustomers";
        
		public static readonly string TblDevice = @"TblDevice";
        
		public static readonly string TblDeviceExpert = @"TblDeviceExpert";
        
		public static readonly string TblExpert = @"TblExperts";
        
		public static readonly string TblProvince = @"TblProvince";
        
		public static readonly string TblReposDetail = @"TblReposDetail";
        
		public static readonly string TblRepository = @"TblRepository";
        
	}
	#endregion
    #region Schemas
    public partial class Schemas {
		
		public static TableSchema.Table Aspnet_Application
		{
            get { return DataService.GetSchema("aspnet_Applications", "DataAccess"); }
		}
        
		public static TableSchema.Table Aspnet_Membership
		{
            get { return DataService.GetSchema("aspnet_Membership", "DataAccess"); }
		}
        
		public static TableSchema.Table Aspnet_Path
		{
            get { return DataService.GetSchema("aspnet_Paths", "DataAccess"); }
		}
        
		public static TableSchema.Table Aspnet_PersonalizationAllUser
		{
            get { return DataService.GetSchema("aspnet_PersonalizationAllUsers", "DataAccess"); }
		}
        
		public static TableSchema.Table Aspnet_PersonalizationPerUser
		{
            get { return DataService.GetSchema("aspnet_PersonalizationPerUser", "DataAccess"); }
		}
        
		public static TableSchema.Table Aspnet_Profile
		{
            get { return DataService.GetSchema("aspnet_Profile", "DataAccess"); }
		}
        
		public static TableSchema.Table Aspnet_Role
		{
            get { return DataService.GetSchema("aspnet_Roles", "DataAccess"); }
		}
        
		public static TableSchema.Table Aspnet_SchemaVersion
		{
            get { return DataService.GetSchema("aspnet_SchemaVersions", "DataAccess"); }
		}
        
		public static TableSchema.Table Aspnet_User
		{
            get { return DataService.GetSchema("aspnet_Users", "DataAccess"); }
		}
        
		public static TableSchema.Table Aspnet_UsersInRole
		{
            get { return DataService.GetSchema("aspnet_UsersInRoles", "DataAccess"); }
		}
        
		public static TableSchema.Table Aspnet_WebEvent_Event
		{
            get { return DataService.GetSchema("aspnet_WebEvent_Events", "DataAccess"); }
		}
        
		public static TableSchema.Table TblCusFolder
		{
            get { return DataService.GetSchema("TblCusFolder", "DataAccess"); }
		}
        
		public static TableSchema.Table TblCustomer
		{
            get { return DataService.GetSchema("TblCustomers", "DataAccess"); }
		}
        
		public static TableSchema.Table TblDevice
		{
            get { return DataService.GetSchema("TblDevice", "DataAccess"); }
		}
        
		public static TableSchema.Table TblDeviceExpert
		{
            get { return DataService.GetSchema("TblDeviceExpert", "DataAccess"); }
		}
        
		public static TableSchema.Table TblExpert
		{
            get { return DataService.GetSchema("TblExperts", "DataAccess"); }
		}
        
		public static TableSchema.Table TblProvince
		{
            get { return DataService.GetSchema("TblProvince", "DataAccess"); }
		}
        
		public static TableSchema.Table TblReposDetail
		{
            get { return DataService.GetSchema("TblReposDetail", "DataAccess"); }
		}
        
		public static TableSchema.Table TblRepository
		{
            get { return DataService.GetSchema("TblRepository", "DataAccess"); }
		}
        
	
    }
    #endregion
    #region View Struct
    public partial struct Views 
    {
		
		public static readonly string ExpProvince = @"ExpProvince";
        
		public static readonly string Vw_Aspnet_Application = @"vw_aspnet_Applications";
        
		public static readonly string Vw_Aspnet_MembershipUser = @"vw_aspnet_MembershipUsers";
        
		public static readonly string Vw_Aspnet_Profile = @"vw_aspnet_Profiles";
        
		public static readonly string Vw_Aspnet_Role = @"vw_aspnet_Roles";
        
		public static readonly string Vw_Aspnet_User = @"vw_aspnet_Users";
        
		public static readonly string Vw_Aspnet_UsersInRole = @"vw_aspnet_UsersInRoles";
        
		public static readonly string Vw_Aspnet_WebPartState_Path = @"vw_aspnet_WebPartState_Paths";
        
		public static readonly string Vw_Aspnet_WebPartState_Shared = @"vw_aspnet_WebPartState_Shared";
        
		public static readonly string Vw_Aspnet_WebPartState_User = @"vw_aspnet_WebPartState_User";
        
    }
    #endregion
    
    #region Query Factories
	public static partial class DB
	{
        public static DataProvider _provider = DataService.Providers["DataAccess"];
        static ISubSonicRepository _repository;
        public static ISubSonicRepository Repository 
        {
            get 
            {
                if (_repository == null)
                    return new SubSonicRepository(_provider);
                return _repository; 
            }
            set { _repository = value; }
        }
        public static Select SelectAllColumnsFrom<T>() where T : RecordBase<T>, new()
	    {
            return Repository.SelectAllColumnsFrom<T>();
	    }
	    public static Select Select()
	    {
            return Repository.Select();
	    }
	    
		public static Select Select(params string[] columns)
		{
            return Repository.Select(columns);
        }
	    
		public static Select Select(params Aggregate[] aggregates)
		{
            return Repository.Select(aggregates);
        }
   
	    public static Update Update<T>() where T : RecordBase<T>, new()
	    {
            return Repository.Update<T>();
	    }
	    
	    public static Insert Insert()
	    {
            return Repository.Insert();
	    }
	    
	    public static Delete Delete()
	    {
            return Repository.Delete();
	    }
	    
	    public static InlineQuery Query()
	    {
            return Repository.Query();
	    }
	    	    
	    
	}
    #endregion
    
}
#region Databases
public partial struct Databases 
{
	
	public static readonly string DataAccess = @"DataAccess";
    
}
#endregion